Circuits and methods for controlling dimming of a light source

ABSTRACT

A controller for controlling dimming of a light source includes a detection pin, an input signal pin, and a monitoring pin. The detection pin is operable for monitoring a rectified voltage and for detecting whether the rectified voltage comes from a TRIAC dimmer or an on/off switch dimmer. The input signal pin is operable for receiving an input signal indicative of the rectified voltage and the controller controls dimming of the light source according to the input signal if the rectified voltage comes from a TRIAC dimmer. The monitoring pin is operable for receiving a monitoring signal indicating an operation of the on/off switch dimmer and the controller controls dimming of the light source according to the monitoring signal if the rectified voltage comes from an on/off switch dimmer.

BACKGROUND

General lighting utilizing light-emitting diodes (LEDs) has been underdevelopment. LEDs offer several advantages over traditional lightsources such as fluorescent lamps and incandescent lamps. For example,LEDs have significant lower power consumption. Unlike traditional lightsources such as incandescent light bulbs that convert significantelectrical current heating up the metal filaments to a temperature highenough to generate light, LEDs generate virtually no heat and utilize afraction of the energy to produce an equivalent lumen of lighting. Forexample, in a light bulb application, an LED light source may consumeless than 7 Watts to produce the same amount of brightness compared toan incandescent light source consuming approximately 60 Watts. In a T-8tube application, the brightness produced by an LED light sourceconsuming less than 20 Watts is even greater than the brightnessproduced by a fluorescent lamp consuming approximately 60 Watts.

The operational life of an LED is extended to 50,000 hours or even100,000 hours. In contrast, the average life of an incandescent bulb isonly approximately 5000 hours and the average life of a fluorescent lampis approximately 15,000 hours. Moreover, LEDs contain no mercury or anyother hazardous materials or chemicals and emit zero ultra violet (UV)radiation unlike incandescent or fluorescent lamps.

Dimming techniques are used to adjust the brightness of the lightsources. For example, a power converter receives an AC voltage from anAC power source and generates a DC voltage to power an LED light source.A controller adjusts the output power of the power converter accordingto a dimmer coupled between the AC power source and the power converterin order to control dimming of the LED light source. Different dimmingtechniques can be used. For example, the dimmer can be a TRIAC dimmer oran on/off switch dimmer. Thus, for different types of dimmers, thecontroller has different structures, thereby affecting the flexibilityof the controller used for powering LEDs in different dimmingtechniques.

SUMMARY

In one embodiment, a controller for controlling dimming of a lightsource includes a detection pin, an input signal pin, and a monitoringpin. The detection pin is operable for monitoring a rectified voltageand for detecting whether the rectified voltage comes from a TRIACdimmer or an on/off switch dimmer. The input signal pin is operable forreceiving an input signal indicative of the rectified voltage and thecontroller controls dimming of the light source according to the inputsignal if the rectified voltage comes from a TRIAC dimmer. Themonitoring pin is operable for receiving a monitoring signal indicatingan operation of the on/off switch dimmer and the controller controlsdimming of the light source according to the monitoring signal if therectified voltage comes from an on/off switch dimmer.

BRIEF DESCRIPTION OF THE DRAWINGS

Features and advantages of embodiments of the claimed subject matterwill become apparent as the following detailed description proceeds, andupon reference to the drawings, wherein like numerals depict like parts,and in which:

FIG. 1 shows a block diagram of a light source driving circuit, inaccordance with one embodiment of the present invention.

FIG. 2A shows a diagram of a light source driving circuit utilizing aTRIAC dimmer, in accordance with one embodiment of the presentinvention.

FIG. 2B shows the waveforms associated with the light source drivingcircuit in FIG. 2A, in accordance with one embodiment of the presentinvention.

FIG. 3A shows a diagram of a light source driving circuit utilizing anon/off switch dimmer, in accordance with one embodiment of the presentinvention.

FIG. 3B shows the waveforms associated with the light source drivingcircuit in FIG. 3A when the switch in the on/off switch dimmer is on, inaccordance with one embodiment of the present invention.

FIG. 4 shows a schematic diagram of a light source driving circuit, inaccordance with one embodiment of the present invention.

FIG. 5 shows an example of a control block in FIG. 4, in accordance withone embodiment of the present invention.

FIG. 6 shows a flowchart of an example of a method for determiningwhether the rectified voltage comes from a TRIAC dimmer or an on/offswitch dimmer, in accordance with one embodiment of the presentinvention.

FIG. 7A shows waveforms of signals associated with the dimmingcontroller in FIG. 4 operating in a first mode, in accordance with oneembodiment of the present invention.

FIG. 7B shows waveforms of signals associated with the dimmingcontroller in FIG. 4 operating in a second mode, in accordance with oneembodiment of the present invention.

DETAILED DESCRIPTION

Reference will now be made in detail to the embodiments of the presentinvention. While the invention will be described in conjunction withthese embodiments, it will be understood that they are not intended tolimit the invention to these embodiments. On the contrary, the inventionis intended to cover alternatives, modifications and equivalents, whichmay be included within the spirit and scope of the invention as definedby the appended claims.

Furthermore, in the following detailed description of the presentinvention, numerous specific details are set forth in order to provide athorough understanding of the present invention. However, it will berecognized by one of ordinary skill in the art that the presentinvention may be practiced without these specific details. In otherinstances, well known methods, procedures, components, and circuits havenot been described in detail as not to unnecessarily obscure aspects ofthe present invention.

FIG. 1 shows a block diagram of a light source driving circuit 100, inaccordance with one embodiment of the present invention. The lightsource driving circuit 100 includes a power source 102, e.g., an ACpower source, a rectifier 108 for rectifying an AC voltage from a TRIACdimmer 104 or an on/off switch dimmer 106 to provide a rectified voltageV_(REC), and a power converter 112 for receiving the rectified voltageV_(REC) and generating regulated power to the light source 118.Advantageously, a dimming controller 110 monitors the rectified voltageV_(REC) from the rectifier 108 and detects whether the AC voltage comesfrom the TRIAC dimmer 104 or the on/off switch dimmer 106. Upondetection of the type of the dimmer, the dimming controller 110 adjuststhe output power of the power converter 112 to control dimming of thelight source 118 according to the type of the dimmer. For example, ifthe TRIAC dimmer 104 is detected, the dimming controller 110 controlsthe dimming according to the operation of the TRAIC dimmer 104 andenables a current path 114 to maintain a holding current of the TRIACdimmer 104. If the on/off switch dimmer 106 is detected, the dimmingcontroller 110 controls the dimming according to the operation of theon/off switch dimmer 106.

FIG. 2A shows a diagram of a light source driving circuit 200 utilizinga TRIAC dimmer 104, in accordance with one embodiment of the presentinvention. Elements labeled the same as in FIG. 1 have similarfunctions. The light source driving circuit 200 includes a power source102, e.g., an AC power source, a TRIAC dimmer 104 for receiving an ACinput voltage V_(IN) from the power source 102 and for generating an ACvoltage V_(TRIAC), a rectifier 108 for rectifying the AC voltageV_(TRIAC) from the TRIAC dimmer 104 to provide a rectified voltageV_(REC), and a power converter 112 for receiving the rectified voltageV_(REC) and generating regulated power to the light source 118.Advantageously, a dimming controller 110 receives a signal indicatingthe rectified voltage V_(REC) from the rectifier 108 and determines thatthe AC voltage received by the rectifier 108 comes from the TRIAC dimmer104. The dimming controller 110 adjusts the output power of the powerconverter 112 to control dimming of the light source 118 accordingly. Inone embodiment, the dimming controller 110 is further operable forconducting a current path 114 to maintain a holding current of the TRIACdimmer 104.

In the example of FIG. 2A, the TRIAC dimmer 104 includes a triac 206coupled between the power source 102 and the rectifier 108. The triac206 has a first terminal A1, a second terminal A2 and a gate G. TheTRIAC dimmer 104 further includes an adjustable resistor 208 coupled inseries with a capacitor 210, and a diac 212 having one end coupled tothe capacitor 210 and the other end coupled to the gate G of the triac206. The triac 206 is a bidirectional switch which can conduct currentin either direction when it is triggered. The triac 206 can be triggeredby a positive or a negative voltage applied to the gate G. Oncetriggered, the triac 206 continues to conduct until the current throughit drops below a threshold value, i.e., the holding current I_(H). Inother words, in order to keep the triac 206 conducting, a currentflowing through the triac 206 is maintained no less than the holdingcurrent I_(H) after the triac 206 is triggered.

FIG. 2B shows the waveforms associated with the light source drivingcircuit 200 in FIG. 2A, in accordance with one embodiment of the presentinvention. More specifically, FIG. 2B shows waveforms of the AC inputvoltage V_(IN), a voltage V_(A2-A1) between the terminal A1 and terminalA2 of the triac 206, a current I_(DIAC) through the diac 212, the ACvoltage V_(TRIAC) provided by the TRIAC dimmer 104, and the rectifiedvoltage V_(REC) from the rectifier 108. In the example of FIG. 2B, theAC input voltage V_(IN) has a sinusoidal waveform. FIG. 2B is describedin combination with FIG. 2A.

Initially, the triac 206 is turned off, and the voltage V_(A2-A1)between the terminal A1 and terminal A2 increases with the AC inputvoltage V_(IN). At time T₁, the voltage across the capacitor 210 turnson the diac 212. The diac 212 generates a current pulse applied to thegate G of the triac 206. The triac 206 is turned on in response to thecurrent pulse. As a result, the AC input voltage V_(IN) passes to therectifier 108, and a current flows through the triac 206. At time T₂which is near the end of the first half cycle of the AC input voltageV_(IN), the triac 206 is turned off because the current through thetriac 206 falls below the holding current of the triac 206. In thesecond half cycle of the input voltage V_(IN), the triac 206 is turnedon again when the voltage across the capacitor 210 turns on the diac212. By increasing or decreasing the resistance of the adjustableresistor 208, the current charging the capacitor 210 is varied such thatthe diac 212 can be conducted at a different phase angle. Consequently,the triac 206 can be turned on with an adjustable conducting angledepending on the resistance of the adjustable resistor 208. Therectifier 108 converts the negative portion of the AC voltage V_(TRIAC)to corresponding positive portion to generate the rectified voltageV_(REC).

FIG. 3A shows a diagram of a light source driving circuit 300 utilizingan on/off switch dimmer 106, in accordance with one embodiment of thepresent invention. Elements labeled the same as in FIG. 1 have similarfunctions. FIG. 3B shows the waveforms associated with the light sourcedriving circuit 300 in FIG. 3A when a switch 302 in FIG. 3A is on, inaccordance with one embodiment of the present invention. FIG. 3A isdescribed in combination with FIG. 3B.

The light source driving circuit 300 includes a power source 102, e.g.,an AC power source, an on/off switch dimmer 106 coupled between thepower source 102 and a rectifier 108, a power converter for receiving arectified voltage V_(REC) from the rectifier 108 and generatingregulated power to the light source 118. Advantageously, a dimmingcontroller 110 receives a signal indicating the rectified voltageV_(REC) from the rectifier 108 and determines that the AC voltagereceived by the rectifier 108 comes from the on/off switch dimmer 106.The dimming controller 110 adjusts the output power of the powerconverter 112 to control dimming of the light source 118 accordingly.

In the example of FIG. 3A, the on/off switch dimmer 106 includes aswitch 302. When the switch 302 is on, the AC input voltage V_(IN) isapplied to the rectifier 108. The rectifier 108 rectifies the AC inputvoltage V_(IN) to a rectified voltage V_(REC). The rectifier 108converts the negative portion of the AC input voltage V_(IN) tocorresponding positive portion to generate the rectified voltageV_(REC).

FIG. 4 shows a schematic diagram of a light source driving circuit 400,in accordance with one embodiment of the present invention. Elementslabeled the same as in FIG. 3 have similar functions. In the example ofFIG. 4, the light source driving circuit 400 drives an LED string 408.The light source driving circuit 400 can be used to drive various typesof light sources. The rectifier 108 can be a bridge rectifier includingfour diodes 408 and a capacitor C7. The power converter 112 includes aninductor L1, a diode D1 and a switch Q1. The switch Q1 is coupled to theLED string 408 and is turned on or off by the dimming controller 110.

In one embodiment, the dimming controller 110 includes a control block190. The control block 190 can be, but is not limited to, an integratedcircuit. In one embodiment, the control block 190 includes pins VDC, RT,GND, SOURCE, CLK, DETECT, VSIN, HV_GATE, VDD, DRAIN, COMP, PWMOFF,BLEED1, BLEED2, IBLD1 and IBLD2. The detection pin DETECT receives asignal indicating the rectified voltage V_(REC) and detects whether therectified voltage V_(REC) comes from a TRIAC dimmer 104 or an on/offswitch dimmer 106. In the example of FIG. 4, the detection pin DETECT iscoupled to the output of the rectifier 108 via a capacitor C3 andresistors R5 and R6.

The input signal pin VSIN receives a signal V_(SIN) indicative of therectified voltage V_(REC). In the example of FIG. 4, the input signalpin VSIN is coupled to the output of the rectifier 108 via resistors R7and R8. The average signal pin VDC receives a signal V_(DC) indicativeof an average V_(AVG) of the rectified voltage V_(REC). In the exampleof FIG. 4, the average signal pin VDC is coupled to the output of therectifier 108 via a capacitor C2 and resistors R1 and R2.

A first bleeding control pin BLEED1 controls a switch Q2 for conductinga first current path including the switch Q2 and a resistor R12 tomaintain a holding current of the TRIAC dimmer 104 if the TRIAC dimmer104 is coupled to the rectifier 108. More specifically, the switch Q2can be turned on if the signal received by the pin DETECT indicates thatthe TRIAC dimmer 104 is coupled to the rectifier 108 and the signalV_(SIN) received by the pin VSIN is greater than the signal V_(DC)received by the pin VDC, in one embodiment. In the example of FIG. 4,the bleeding control pin BLEED1 controls the switch Q2 linearlyaccording to a sensing signal, e.g., a voltage across the resistor R12,received by the pin IBLD1.

A second bleeding control pin BLEED2 controls a switch Q3 for conductinga second current path including the switch Q3 and a resistor R11 tomaintain a holding current of the TRIAC dimmer 104 if the TRIAC dimmer104 is coupled to the rectifier 108. More specifically, the switch Q3can be turned on if the signal received by the pin DETECT indicates thatthe TRIAC dimmer 104 is coupled to the rectifier 108 and the signalV_(SIN) received by the pin VSIN is less than the signal V_(DC) receivedby the pin VDC, in one embodiment. In the example of FIG. 4, thebleeding control pin BLEED2 controls the switch Q3 linearly according toa sensing signal, e.g., a voltage across the resistor R11, received bythe pin IBLD2.

The pin CLK receives a switch monitoring signal indicating an operationof the on/off switch dimmer 106 if the on/off switch dimmer 106 iscoupled to the rectifier 108. In the example of FIG. 4, the pin CLK iscoupled to the output of the rectifier 108 via a capacitor C1 andresistors R3 and R4. If the on/off switch dimmer 106 is coupled to therectifier 108, a voltage across the resistor R4 drops to zero when theon/off switch dimmer 106 is turned off. Thus, a switch monitoring signalindicating a turn-off operation of the on/off switch dimmer 106 isdetected by the pin CLK. The voltage across the resistor R4 rises to apredetermined voltage when the on/off switch dimmer 106 is turned on.Thus, a switch monitoring signal indicating a turn-on operation of theon/off switch dimmer 106 is detected by the pin CLK.

Moreover, the pin HV_GATE controls the switch Q1. In operation, if theon/off switch dimmer 106 is utilized and a turn-on operation of theon/off switch dimmer 106 is detected at the pin CLK, the control block190 turns on the switch Q1. If a turn-off operation of the on/off switchdimmer 106 is detected at the pin CLK, the control block 190 turns offthe switch Q1 such that the LED string 408 is turned off after theinductor L1 completes discharging. The pin VDD is coupled to the switchQ1 for providing power to the control block 190. The pin DRAIN iscoupled to the switch Q1. The pin SOURCE is coupled to the resistor R13.The pin COMP is coupled to the capacitor C5. The pin GND is coupled toground. The pin RT is coupled to ground via a resistor R14 fordetermining a frequency of a pulse signal generated by the control block190.

FIG. 5 shows an example of a control block 190 in FIG. 4, in accordancewith one embodiment of the present invention. FIG. 5 is described incombination with FIG. 4.

The control block 190 includes a driver 516 for controlling a switch Q4coupled between the pin DRAIN and the pin SOURCE to control a current ofthe LED string 408, a comparator 514 for comparing an input signalV_(SIN) indicative of the rectified voltage V_(REC) with an averagesignal V_(DC) indicative of an average V_(AVG) of the rectified voltageV_(REC) to generate a pulse-width modulation signal LPWM, a multi-leveldimmer 538 coupled to the pin CLK for adjusting brightness of the LEDstring 408 in response to the operation of the on/off switch dimmer 106,a voltage detector 540 for monitoring the rectified voltage V_(REC), ableeding controller 542 for controlling an error amplifier 550 tocontrol the first current path including the switch Q2 and the resistorR12 shown in FIG. 4, a bleeding controller 546 for controlling an erroramplifier 552 to control the second current path including the switch Q3and the resistor R11 shown in FIG. 4. The control block 190 furtherincludes an over-temperature protection unit 502, a short-circuitprotection unit 504, an over-current protection unit 506 and anunder-voltage lockout unit 510.

In the example of FIG. 5, the control block 190 determines whether therectified voltage V_(REC) comes from a TRIAC dimmer 104 or an on/offswitch dimmer 106 by using the voltage detector 540, a clock 532, acounter 534, and a comparator 536. FIG. 6 shows a flowchart of anexample of a method for determining whether the rectified voltageV_(REC) comes from a TRIAC dimmer 104 or an on/off switch dimmer 106, inaccordance with one embodiment of the present invention. FIG. 6 isdescribed in combination with FIG. 5.

In block 602, the voltage detector 540 monitors the rectified voltageV_(REC) by receiving a signal indicating the rectified voltage V_(REC)via the detection pin DETECT. In block 604, if the rectified voltageV_(REC) is greater than a first preset voltage V₁, the flowchart goes toblock 606 and the voltage detector 540 enables the clock 532 to drivethe counter 534. In block 608, a counter value of the counter 534increases by 1 in response to each clock pulse generated by the clock532. In block 610, if the rectified voltage V_(REC) is less than asecond preset voltage V₂, the flowchart goes back to block 608. In block610, if the voltage of the rectified voltage V_(REC) is greater than thesecond preset voltage V₂, the flowchart goes to block 612 and thevoltage detector 540 disables the clock 532. In block 614, the countervalue is compared with a reference value CNT by the comparator 536. Inblock 616, if the counter value is greater than CNT, the comparator 536generates a selection signal indicating that the rectified voltageV_(REC) comes from the on/off switch dimmer 106. In block 618, if thecounter value is less than CNT or equal to CNT, the comparator 536generates a selection signal indicating that the rectified voltageV_(REC) comes from the TRIAC dimmer 104.

Referring back to FIG. 5, if the control block 190 determines that therectified voltage V_(REC) comes from the on/off switch dimmer 106, theSR flip-flop 528, the bleeding controller 542, the error amplifier 550,the bleeding controller 546, and the error amplifier 552 are disabled,in one embodiment. The multi-level dimmer 538 is enabled to output adimming signal ADJ according to the operation of the on/off switchdimmer 106. The multi-level dimmer 538 receives a switch monitoringsignal indicating an operation of the on/off switch dimmer 106 via thepin CLK. For example, a voltage of the dimming signal ADJ decreases froma first level to a second level in response to a turn-off operation ofthe on/off switch dimmer 106. An amplifier 530 compares the dimmingsignal ADJ with a sensing signal SEN received from the current sensingpin SOURCE. The sensing signal SEN indicates a current of the LED string408. A sample-hold circuit 520 receives the output of the amplifier 530.A comparator 518 generates a control signal CTRL1 to control the switchQ4 by comparing a sawtooth signal SAW generated by an oscillator 524with the output of the sample-hold circuit 520. The comparator 514 iscoupled to the input signal pin VSIN and the average signal pin VDC, andcompares an input signal V_(SIN) indicative of the rectified voltageV_(REC) with an average signal V_(DC) indicative of an average V_(AVG)of the rectified voltage V_(REC) to generate a pulse-width modulationsignal LPWM. In one embodiment, if V_(SIN) is greater than V_(DC), thepulse-width modulation signal LPWM is in a first state (e.g., logic 1)and the switch Q4 is controlled by the output of the comparator 518.More specifically, in one embodiment, if the output of the sample-holdcircuit 520 is greater than the sawtooth signal SAW, the comparator 518generates the control signal CTRL1 in a first state (e.g., logic 1) toturn on the switch Q4. If the output of the sample-hold circuit 520 isless than the sawtooth signal SAW, the comparator 518 generates thecontrol signal CTRL1 in a second state (e.g., logic 0) to turn off theswitch Q4. Therefore, when the pulse-width modulation signal LPWM is ina first state, the duty cycle of the control signal CTRL1 variesaccording to the dimming signal ADJ which is further determined by theswitch monitoring signal indicating the operation of the on/off switchdimmer 106.

If V_(SIN) is less than V_(DC), the pulse-width modulation signal LPWMis in a second state (e.g., logic 0) and the switch Q4 remains offduring the second state of the pulse-width modulation signal LPWM. Inother words, the switch Q4 is turned on and off alternately according tothe control signal CTRL1 during the first state of the pulse-widthmodulation signal LPWM, and the switch Q4 remains off during the secondstate of the pulse-width modulation signal LPWM.

In one embodiment, if the control block 190 determines that therectified voltage V_(REC) comes from the TRIAC dimmer 104, themulti-level dimmer 538, the amplifier 530, the sample-hold circuit 520,and the comparator 518 are disabled. The SR flip-flop 528, the bleedingcontroller 542, the error amplifier 550, the bleeding controller 546,and the error amplifier 552 are enabled.

The comparator 514 compares an input signal V_(SIN) indicative of therectified voltage V_(REC) with an average signal V_(DC) indicative of anaverage V_(AVG) of the rectified voltage V_(REC) to generate apulse-width modulation signal LPWM. If V_(SIN) is greater than V_(DC),the pulse-width modulation signal LPWM is in a first state (e.g., logic1). During the first state of the pulse-width modulation signal LPWM,the switch Q1 shown in FIG. 4 is on and the switch Q4 is controlled bythe output CTRL2 of the SR flip-flop 528. More specifically, the S inputof the SR flip-flop 528 receives a pulse signal PULSE generated by theoscillator 524. The SR flip-flop 528 outputs a logic 1 in response toeach pulse in the pulse signal to turn on the switch Q4. A comparator526 compares a reference signal REF3 with the sensing signal SENreceived from the current sensing pin SOURCE. The reference signal REF3determines a peak level of the current of the LED string 408. Thesensing signal SEN indicates a current of the LED string 408 when theswitch Q4 is on. If the sensing signal SEN increases to REF3, thecomparator 526 generates a logic 1 at the R input of the SR flip-flop528 such that the SR flip-flop 528 outputs a logic 0 to turn off theswitch Q4. If V_(SIN) is less than V_(DC), the pulse-width modulationsignal LPWM is in a second state (e.g., logic 0) and the switches Q1 andQ4 are turned off. In other words, the switch Q4 is turned on and offalternately according to output of the SR flip-flop 528 during the firststate of the pulse-width modulation signal LPWM, and the switch Q4remains off during the second state of the pulse-width modulation signalLPWM.

The bleeding controller 542 is operable for turning on a switch 548coupled between the pin BLEED1 and the error amplifier 550 to conduct afirst current path including the switch Q2 and the resistor R12 (shownin FIG. 4) during a first state of the pulse-width modulation signalLPWM. As such, a current flows from the rectifier 108 through the switchQ2 and the resistor R12 to ground. The error amplifier 550 receives areference signal REF1 and a sensing signal indicating a voltage acrossthe resistor R12 and controls the switch Q2 linearly to maintain thecurrent through the switch Q2 and the resistor R12 no less than theholding current of the TRIAC dimmer 104.

The bleeding controller 546 is operable for turning on a switch 554coupled between the pin BLEED2 and the error amplifier 552 to conduct asecond current path including the switch Q3 and the resistor R11 (shownin FIG. 4) during a second state of the pulse-width modulation signalLPWM. As such, a current flows from the rectifier 108 through the switchQ3 and the resistor R11 to ground. The error amplifier 552 receives thereference signal REF1 and a sensing signal indicating a voltage acrossthe resistor R11 and controls the switch Q3 linearly to maintain thecurrent through the switch Q3 and the resistor R11 no less than theholding current of the TRIAC dimmer 104. Moreover, in one embodiment,the bleeding controller 546 receives a setting signal from the pinPWMOFF. The setting signal determines a minimum duty cycle D_(MIN) ofthe pulse-width modulation signal LPWM. If the duty cycle decreases tothe minimum duty cycle D_(MIN), the control block 190 turns off theswitch Q4 and the bleeding controller 546 conducts the second currentpath. Therefore, in one embodiment, the bleeding controller 546 turns onthe switch 554 to conduct the second current path when either of thefollowing conditions occurs: when the pulse-width modulation signal LPWMis in the second state or when the duty cycle of the pulse-widthmodulation signal LPWM decreases to the minimum duty cycle D_(MIN).

When the pulse-width modulation signal LPWM is in the first state, theswitch Q4 is turned on and off alternately. Thus, a current flowsthrough the LED string 408 to ground during the first state of the LPWM.The control block 190 is operable for conducting the first current pathto maintain the holding current of the TRIAC dimmer 104. When thepulse-width modulation signal LPWM is in the second state, the switch Q4remains off. Thus, no current flows through the LED string 408 to groundduring the second state of the LPWM. The control block 190 is operablefor conducting the second current path to maintain the holding currentof the TRIAC dimmer 104. As such, to maintain the same holding currentof the TRIAC dimmer 104, the bleeding current flowing through the firstcurrent path during the first state of the LPWM is less than thebleeding current flowing through the second current path during thesecond state of the LPWM. Although the example of FIG. 4 shows twocurrent paths, i.e., one includes the switch Q2 and resistor R12 and theother includes the switch Q3 and resistor R11, the invention is not solimited. In another embodiment, one current path can be employed tomaintain the holding current of the TRIAC dimmer 104.

As discussed in the example of FIG. 5, when the TRIAC dimmer 104 isused, the dimming of the light source 118 is controlled by comparing theinput signal V_(SIN) indicative of the rectified voltage V_(REC) withthe average signal V_(DC) indicative of an average V_(AVG) of therectified voltage V_(REC), in one embodiment. Alternatively, when theTRIAC dimmer 104 is used, the dimming of the light source 118 can alsobe controlled by calculating the conducting angle of the rectifiedvoltage V_(REC).

During the operation, if any abnormal situation such as overtemperature, short circuit or over current is detected, theover-temperature protection unit 502, short-circuit protection unit 504,or over-current protection unit 506 can generate a control signal, e.g.,logic 0, to the driver 516 via the AND gates 508 and 512 to turn off theswitch Q4.

FIG. 7A shows waveforms of signals associated with the dimmingcontroller in FIG. 4 operating in a first mode, i.e., the on/off switchdimming mode, in accordance with one embodiment of the presentinvention. More specifically, FIG. 7A shows the status of the switch302, the rectified voltage V_(REC) from the rectifier 108, thepulse-width modulation signal LPWM generated by the comparator 514, thedimming signal ADJ generated by the multi-level dimmer 538, the sawtoothsignal SAW provided by the oscillator 524, the output V₅₂₀ of thesample-hold circuit 520, and the control signal CTRL1 generated by thecomparator 518, when the on/off switch dimmer 106 is utilized. FIG. 7Ais described in combination with FIG. 4 and FIG. 5.

In operation, when the switch 302 is on, the comparator 514 compares aninput signal V_(SIN) indicative of the rectified voltage V_(REC) with anaverage signal V_(DC) indicative of an average V_(AVG) of the rectifiedvoltage V_(REC) to generate the pulse-width modulation signal LPWM. Inone embodiment, if V_(SIN) is greater than V_(DC), the pulse-widthmodulation signal LPWM is in a first state (e.g., logic 1). If V_(SIN)is less than V_(DC), the pulse-width modulation signal LPWM is in asecond state (e.g., logic 0). The oscillator 524 provides the sawtoothsignal SAW. When the pulse-width modulation signal LPWM is in the firststate, the comparator 518 generates the control signal CTRL1 to turn theswitch Q4 (shown in FIG. 4) on and off alternately by comparing thesawtooth signal SAW with the output V₅₂₀ of the sample-hold circuit 520.V₅₂₀ is proportional to the dimming signal ADJ which is generated by themulti-level dimmer 538, in one embodiment. In one embodiment, if theoutput of the sample-hold circuit 520 is greater than the sawtoothsignal, the comparator 518 generates the control signal CTRL1 in a firststate (e.g., logic 1) to turn on the switch Q4. If the output of thesample-hold circuit 520 is less than the sawtooth signal, the comparator518 generates the control signal CTRL1 in a second state (e.g., logic 0)to turn off the switch Q4. When the pulse-width modulation signal LPWMis in the second state, the control signal CTRL1 is zero and thus theswitch Q4 remains off.

If the switch 302 is turned off, the switch monitoring signal indicatinga turn-off operation of the on/off switch dimmer 106 is received by themulti-level dimmer 538 via the pin CLK. Accordingly, when the switch 302is turned on again, the multi-level dimmer 538 decreases a voltage ofthe dimming signal ADJ from a first level to a second level, in oneembodiment. The voltage of the output V₅₂₀ of the sample-hold circuit520 decreases accordingly. As a result, a duty cycle of the controlsignal CTRL1 is decreased. Therefore, the brightness of the LED string408 is reduced. In other words, when the on/off switch dimmer 106 isused, the duty cycle of the control signal CTRL1 varies according to thedimming signal ADJ which is further determined by the switch monitoringsignal received by pin CLK.

FIG. 7B shows waveforms of signals associated with the dimmingcontroller in FIG. 4 operating in a second mode, i.e., the TRIAC dimmingmode, in accordance with one embodiment of the present invention. Morespecifically, FIG. 7B shows the rectified voltage V_(REC) from therectifier 108, the pulse-width modulation signal LPWM generated by thecomparator 514, the sensing signal SEN received from the current sensingpin SOURCE of the control block 190, the pulse signal PULSE provided bythe oscillator 524, and the output CTRL2 of the SR flip-flop 528, whenthe TRIAC dimmer 104 is utilized. FIG. 7B is described in combinationwith FIG. 4 and FIG. 5.

In one embodiment, the comparator 514 compares an input signal V_(SIN)indicative of the rectified voltage V_(REC) with an average signalV_(DC) indicative of an average V_(AVG) of the rectified voltage V_(REC)to generate the pulse-width modulation signal LPWM. If V_(SIN) isgreater than V_(DC), the pulse-width modulation signal LPWM is in afirst state (e.g., logic 1). If V_(SIN) is less than V_(DC), thepulse-width modulation signal LPWM is in a second state (e.g., logic 0).The oscillator 524 provides the pulse signal PULSE. The output CTRL2 ofthe SR flip-flop 528 turns to logic 1 in response to each pulse in thepulse signal, in one embodiment. If the switch Q4 is turned on, acurrent through the LED string 408 increases such that the sensingsignal SEN increases. If the sensing signal SEN increases to REF3, thecomparator 526 generates a logic 1 at the R input of the SR flip-flop528 such that the output CTRL2 of the SR flip-flop 528 turns to logic 0.

If a user adjusts the TRIAC dimmer 104 to reduce the conduction time ofthe triac 206, the duty cycle of the pulse-width modulation signal LPWMdecreases. Consequently, the brightness of the LED string 408 decreases.Thus, when the TRIAC dimmer 104 is used, the brightness of the LEDstring 408 varies according to the rectified voltage V_(REC). In theexample of FIG. 7B, the pulse-width modulation signal LPWM is obtainedby comparing the input signal V_(SIN) indicative of the rectifiedvoltage V_(REC) with the average signal V_(DC) indicative of an averageV_(AVG) of the rectified voltage V_(REC). In alternative embodiment,when the TRIAC dimmer 104 is used, the pulse-width modulation signalLPWM can also be obtained by calculating the conducting angle of therectified voltage V_(REC). For example, the pulse-width modulationsignal LPWM is in the first state (e.g., logic 1) during the conductingangle of the rectified voltage V_(REC). Otherwise, the pulse-widthmodulation signal LPWM is in the second state (e.g., logic 0).

Accordingly, embodiments in accordance with the present inventionprovide circuits and methods for controlling dimming of a light source.A dimming controller is capable of detecting whether a TRIAC dimmer oran on/off switch dimmer is coupled between a power source and a powerconverter. Upon detection of the type of the dimmer, the dimmingcontroller controls the dimming of the light source accordingly. Forexample, if the TRIAC dimmer is detected, the dimming controllercontrols the dimming according to the operation of the TRAIC dimmer. Ifthe on/off switch dimmer is detected, the dimming controller controlsthe dimming according to the operation of the on/off switch dimmer.Advantageously, the dimming controller can be adapted to different typesof dimmers and thus its flexibility is enhanced.

While the foregoing description and drawings represent embodiments ofthe present invention, it will be understood that various additions,modifications and substitutions may be made therein without departingfrom the spirit and scope of the principles of the present invention asdefined in the accompanying claims. One skilled in the art willappreciate that the invention may be used with many modifications ofform, structure, arrangement, proportions, materials, elements, andcomponents and otherwise, used in the practice of the invention, whichare particularly adapted to specific environments and operativerequirements without departing from the principles of the presentinvention. The presently disclosed embodiments are therefore to beconsidered in all respects as illustrative and not restrictive, thescope of the invention being indicated by the appended claims and theirlegal equivalents, and not limited to the foregoing description.

1. A controller for controlling dimming of an LED light source, saidcontroller comprising: a detection pin operable for monitoring arectified voltage and for detecting whether said rectified voltage comesfrom a TRIAC dimmer or an on/off switch dimmer; an input signal pinoperable for receiving an input signal indicative of said rectifiedvoltage, wherein said controller is configured to control dimming ofsaid LED light source by controlling a switch in series with said LEDlight source according to said input signal if said rectified voltagecomes from said TRIAC dimmer; and a monitoring pin operable forreceiving a monitoring signal indicating an operation of said on/offswitch dimmer, wherein said controller is configured to control dimmingof said LED light source by controlling said switch according to saidmonitoring signal if said rectified voltage comes from said on/offswitch dimmer.
 2. The controller of claim 1, further comprising: ableeding control pin operable for conducting a current path to maintaina holding current of said TRIAC dimmer if said rectified voltage comesfrom said TRIAC dimmer.
 3. The controller of claim 1, wherein saidcontroller is configured to control dimming of said LED light source bycalculating a conducting angle of said rectified voltage if saidrectified voltage comes from said TRIAC dimmer.
 4. The controller ofclaim 1, further comprising: an average signal pin operable forreceiving an average signal indicative of an average of said rectifiedvoltage, wherein said controller is configured to control dimming ofsaid LED light source by comparing said input signal to said averagesignal if said rectified voltage comes from said TRIAC dimmer.
 5. Thecontroller of claim 1, wherein said controller is configured to generatea pulse-width modulation signal, and wherein said controller is operablefor turning said switch on and off alternately during a first state ofsaid pulse-width modulation signal, and wherein said switch remains offduring a second state of said pulse-width modulation signal.
 6. Thecontroller of claim 5, wherein said pulse-width modulation signal isgenerated by comparing said input signal to an average signal indicativeof an average of said rectified voltage.
 7. The controller of claim 5,further comprising: a first bleeding control pin operable for conductinga first current path to maintain a holding current of said TRIAC dimmerif said rectified voltage comes from said TRIAC dimmer; and a secondbleeding control pin operable for conducting a second current path tomaintain said holding current of said TRIAC dimmer if said rectifiedvoltage comes from said TRIAC dimmer, wherein said first bleedingcontrol pin is operable for conducting said first current path duringsaid first state of said pulse-width modulation signal, and wherein saidsecond bleeding control pin is operable for conducting said secondcurrent path during said second state of said pulse-width modulationsignal.
 8. (canceled)
 9. The controller of claim 5, further comprising:a current sensing pin operable for providing a sensing signal indicativeof a current of said LED light source; a comparator operable forcomparing said sensing signal to a predetermined reference, wherein saidswitch is turned on and off during said first state of said pulse-widthmodulation signal according to an output of said comparator and a pulsesignal.
 10. The controller of claim 5, further comprising: a currentsensing pin operable for providing a sensing signal indicative of acurrent of said LED light source; an amplifier operable for comparingsaid sensing signal to a dimming signal, wherein a level of said dimmingsignal is determined by said operation of said on/off switch dimmer,wherein said switch is turned on and off during said first state of saidpulse-width modulation signal based on an output of said amplifier. 11.(canceled)
 12. The controller of claim 1, further comprising: a clockgenerator coupled to said detection pin and operable for generating aclock signal when said rectified voltage is greater than a first presetvoltage and less than a second preset voltage; and a counter coupled tosaid clock generator and operable for counting pulses of said clocksignal.
 13. The controller of claim 12, further comprising: a comparatorcoupled to said counter and operable for generating a selection signalby comparing a counter value of said counter to a reference value,wherein said selection signal indicates whether said rectified voltagecomes from said TRIAC dimmer or said on/off switch dimmer.
 14. A systemcomprising: a rectifier operable for rectifying an AC voltage andgenerating a rectified voltage; a power converter coupled to saidrectifier and operable for receiving said rectified voltage andgenerating regulated power to a light emitting diode (LED) light source;a dimming controller operable for detecting whether said AC voltagecomes from a TRAIC dimmer or an on/off switch dimmer and for controllingsaid power converter so as to control dimming of said LED light source,wherein said dimming controller is operable for controlling dimming ofsaid LED light source by controlling a switch in series with said LEDlight source according to said rectified voltage if said AC voltagecomes from said TRIAC dimmer, and wherein said dimming controller isoperable for controlling dimming of said LED light source by controllingsaid switch according to an operation of said on/off switch dimmer ifsaid AC voltage comes from said on/off switch dimmer.
 15. The system ofclaim 14, wherein said dimming controller is operable for controllingLED dimming of said light source by comparing an input signal indicativeof said rectified voltage to an average signal indicative of an averageof said rectified voltage if said rectified voltage comes from saidTRIAC dimmer.
 16. The system of claim 14, wherein said dimmingcontroller is operable for controlling dimming of said LED light sourceby calculating a conducting angle of said rectified voltage if saidrectified voltage comes from said TRIAC dimmer.
 17. The system of claim14, wherein said dimming controller is operable for generating apulse-width modulation signal, and wherein said switch is switched onand off alternately during a first state of said pulse-width modulationsignal, and wherein said switch remains off during a second state ofsaid pulse-width modulation signal.
 18. The system of claim 17, whereinsaid dimming controller is configured to generate said pulse-widthmodulation signal by comparing an input signal indicative of saidrectified voltage to an average signal indicative of an average of saidrectified voltage.
 19. (canceled)
 20. The system of claim 17, whereinsaid dimming controller is operable for comparing a sensing signalindicative of a current through said LED light source to a predeterminedreference, and wherein said switch is turned on and off during saidfirst state of said pulse-width modulation signal according to a pulsesignal and a comparison result of said sensing signal and saidpredetermined reference.
 21. The system of claim 17, wherein saiddimming controller is operable for comparing a sensing signal indicativeof a current through said LED light source to a dimming signal, whereina level of said dimming signal is determined by said operation of saidon/off switch dimmer, and wherein said switch is turned on and offduring said first state of said pulse-width modulation signal accordingto a sawtooth signal and a comparison result of said sensing signal andsaid dimming signal.
 22. The system of claim 14, wherein said dimmingcontroller comprises: a clock generator operable for generating a clocksignal when said rectified voltage is greater than a first presetvoltage and less than a second preset voltage; and a counter coupled tosaid clock generator and operable for counting pulses of said clocksignal.
 23. The system of claim 22, wherein said dimming controllerfurther comprises: a comparator coupled to said counter and operable forgenerating a selection signal by comparing a counter value of saidcounter to a reference value, wherein said selection signal indicateswhether said AC voltage comes from said TRIAC dimmer or said on/offswitch dimmer.